//
// RS Game Framework
// Copyright © 2009 Jedd Haberstro
// jhaberstro@gmail.com
// 
// $Id:
//

#ifndef RS_REFLECTION_CLASSBUILDERINTERFACE_HPP
#define RS_REFLECTION_CLASSBUILDERINTERFACE_HPP

#include "rs/reflection/Constructor.hpp"
#include "rs/Portability.hpp"
#include <vector>

namespace rs
{
    namespace reflection
    {
        class Attribute;
        class Class;
        class Method;
        
        namespace internal
        {
            typedef void (*Destructor)(void* object);
            
            template< typename TClass >
            void DestructorFunction(void* object) {
                static_cast< TClass* >(object)->TClass::~TClass();
            }
        }
        
        namespace hidden
        {
            class ClassBuilderInterface
            {
            private:
                
                typedef std::vector< Constructor > ConstructorContainer;
                
            public:
                virtual Class const* GetParentClass() const = 0;
                virtual Char8 const* GetClassName() const = 0;
                virtual Attribute* BuildAttributes() const = 0;
                virtual Method* BuildMethods() const = 0;
                virtual RsSize GetAttributeCount() const = 0;
                virtual RsSize GetMethodCount() const = 0;
                virtual ConstructorContainer const& GetConstructors() const = 0;
                virtual internal::Destructor GetDestructor() const = 0;
                virtual void FinalizeClassVisitor() = 0;
            };
        }
    }
}

#endif // RS_REFLECTION_CLASSBUILDERINTERFACE_HPP
